using System;

namespace Hvac
{
    public enum FanMode
    {
        Auto = 0,
        On = 1
    }

    public class HvacChangedEventArgs : EventArgs
    {
        readonly bool isRunning;
        readonly int mode;

        public bool IsRunning { get { return isRunning; } }
        public int Mode { get { return mode; } }

        public HvacChangedEventArgs(bool isRunning, int mode)
        {
            this.isRunning = isRunning;
            this.mode = mode;
        }
    }

    /// <summary>
    /// Represents the HVAC unit
    /// </summary>
    /// <remarks>
    /// 
    /// </remarks>
    public interface IHvacController
    {
        // Demand conditioned air. negative values request cooling, positive values request heat
        void Demand(double factor);

        /// <summary>
        /// Get or set the current operating mode
        /// 1 == cool, 0 == off, -1 == heat
        /// </summary>
        int Mode
        {
            get;
            set;
        }

        /// <summary>
        /// return true if running
        /// </summary>
        bool IsRunning
        {
            get;
        }

        /// <summary>
        /// Fired anytime Mode or IsRunning or Mode changes
        /// </summary>
        event EventHandler<HvacChangedEventArgs> HvacChanged;

        /// <summary>
        /// Get or set the fan operating mode
        /// </summary>
        FanMode FanStatus
        {
            get;
            set;
        }

        bool Enabled
        {
            get;
            set;
        }
    }
}